/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.vendingmachine;

/**
 *
 * @author Zeus
 */
public class VendingMachineImpl implements VendingMachine {

    @Override
    public double retrieveItemPrice(String item) {
        if (item.equalsIgnoreCase("Coke")) {
            return 8.00;
        } else if (item.equalsIgnoreCase("Sprite")) {
            return 7.50;
        } else {
            return 0.00;
        }
    }

    @Override
    public double amountPaid(double amount) {
        return amount;
    }

    @Override
    public double changeReceived(double amountPaid, double itemPrice) {
        if (itemPrice > amountPaid) {
            System.out.println("not enough money inserted");
            return 0.00;
        } else {
            return amountPaid - itemPrice;
        }
    }

    @Override
    public String selectItem(String item) {
        return item;
    }
}
